﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Devtm.Common
{
    
    public static class Exceptions
    {


        internal static Exception Exception(this object sender, string txt, params object[] parameters)
        {
            Logger.Log(sender, LogLevelEnm.Exception, txt, parameters, Tags.Exception);
            return new Exception(string.Format(txt, parameters));
        }


        internal static ArgumentNullException ArgumentNull(this object sender, string parameterName)
        {
            string msg = string.Format(Strings.ArgumentNullExceptionInvokedOnTheElement, parameterName);
            Logger.Log(sender, LogLevelEnm.Exception, msg, Tags.Exception);
            return new ArgumentNullException(parameterName);
        }


        internal static NullReferenceException NullReferenceException(this object sender, string parameterName)
        {
            string msg = string.Format(Strings.ArgumentNullExceptionInvokedOnTheElement, parameterName);
            Logger.Log(sender, LogLevelEnm.Exception, msg, Tags.Exception);
            return new NullReferenceException(parameterName);
        }




    }


}
